// tslint:disable-next-line: ordered-imports
import query from '@dfeidao/atom-nodejs/db/query';
import { IncomingHttpHeaders } from 'http';
import { productid, systemid } from '../../atom/config';
interface Message {
	filter: {
		project_no: string[]
	};
}
/* 表名	asset_inventory
标题	资产盘点
字段名称	字段标题	字段类型	字段长度	是否为空	是否主键
project_name	项目名称	string	500	√	ⅹ
inventory_people	盘点人	string	50	√	ⅹ
inventory_time	盘点时间	timestamp	50	√	ⅹ
_id	id	string	50	ⅹ	√
productid	产品id	string	50	√	ⅹ
project_id	项目编号	string	50	√	ⅹ
customer_reviews	客户签名	blob	50	√	ⅹ
record_no	记录编号	string	50	√	ⅹ
lnventory_name	盘点名称	string	100	√	ⅹ
inventory_people_no	盘点人编号	string	50	√	ⅹ */
export default async function atom(message: Message, action_id: string, session_id: string, headers: IncomingHttpHeaders) {
	const p = query(action_id, session_id, systemid);
	p.prepare('asset_inventory', ['project_id'],
	{ productid, project_id: { $in: message.filter.project_no } }, 20, 1, [], []);
	const [dt] = await p.exec();
	return { dt };
}
